import java.util.*;
import java.io.*;
/**
 * Write a description of class Heater here.
 * 
 * @author (Michael Lavina) 
 * @version (1/30/2012)
 */
public class Heater
{
    // instance variables - replace the example below with your own
    protected int temperature, min, max, increment;
    protected Boolean isFarenheit;

    /**
     * Constructor for objects of class Heater
     */
    public Heater(int min, int max)
    {
        // initialise instance variables
        temperature = 1500;
        this.min = min;
        this.max = max;
        increment = 5;
        isFarenheit = false;
    }

    /**
     * Mutator that increases value of temperature by 5 degrees
     */
    public void warmer()
    {
        // increases temperature
        temperature +=increment;
        if(temperature >= max)
            temperature = max;
    }
    /**
     * Mutator that decreases value of temperature by 5 degrees
     */
    public void cooler()
    {
        // decreases temperature
        temperature -=increment;
        if(temperature <= min)
            temperature = min;
    }
    /*
     * Mutator that sets the increment value
     */
    public void setIncrement(int increment)
    {
        this.increment = increment+100;
    }
    /*
     * Acessor method to get value of temperature
     * @return temperature
     */
    public int getTemperature()
    {
        return temperature;
    }
    public void printTemperature()
    {
        double temp = (double)(temperature);
        temp = temp/100;
         if(isFarenheit)
            {
                 System.out.println("\nTemperature: " + temp + " degree Farenheit\n");
            }
        else
            {
               System.out.println("\nTemperature: " + temp + " degree Celsius\n");
            }
        
    }
    public void printCurrentHeaterInterval()
    {
        System.out.println("Current Heater Increment: " + increment);
    }
    public void switchUnits()
    {
        if(isFarenheit)
            {
                temperature = (int) Temperature.getCelsius(temperature);
            }
        else
            {
                temperature = (int) Temperature.getFarenheit(temperature);
            }
        isFarenheit = !isFarenheit;
    }
}
